<?php
/**
 * Created by JetBrains PhpStorm.
 * User: T420
 * Date: 11/29/12
 * Time: 10:43 PM
 * To change this template use File | Settings | File Templates.
 */
class Models_Manufacture extends Libs_Model
{
    public function __construct()
    {
        parent::__construct();
    }
    public function getmanufacture()
    {
        $this->db->connect();
        $list=$this->db->executeQuery("select * from lb_manufactures");
        $this->db->disconnect();
        return $list;
    }
    public function delmf($id)
    {
        $this->db->connect();
        $list=$this->db->query("delete from lb_manufactures where mfid='$id'");
        $this->db->disconnect();

    }
    public function insertmf($tenhang,$trangthaihang)
    {
        $this->db->connect();
        $list=$this->db->query("insert lb_manufactures(mfname,status) values('$tenhang','$trangthaihang')");
        $this->db->disconnect();
    }
    public function checkmf($mfname)
    {
        $this->db->connect();
        $list=$this->db->executeQuery("select * from lb_manufactures where mfname='$mfname'");
        $this->db->disconnect();
        return $list;
    }
    function updatehang($id,$stt)
    {
        $this->db->connect();
        $list=$this->db->query("update lb_manufactures set status='$stt' where mfid='$id'");
        $this->db->disconnect();
    }
}
